package edu.webarchitechture.bank.ejb3.services;

import edu.webarchitechture.bank.ejb3.exception.AccountNotFoundException;
import edu.webarchitechture.bank.ejb3.exception.IllegalAccountTypeException;
import edu.webarchitechture.bank.ejb3.exception.CustomerNotFoundException;
import edu.webarchitechture.bank.ejb3.exception.InvalidParameterException;
import edu.webarchitechture.bank.ejb3.domain.Account;

import javax.ejb.Local;
import java.util.List;

/**
 * Interface to manage the bank account related tasks.
 * 
 * @author Inoka Dissanayaka.
 */
@Local
public interface AccountManager {

	void addCustomerToAccount(Long customerId, Long accountId)
			throws InvalidParameterException, CustomerNotFoundException,
			AccountNotFoundException;

	Long createAccount(Account account, Long customerId)
			throws IllegalAccountTypeException, CustomerNotFoundException,
			InvalidParameterException;

	List<Account> getAccountsOfCustomer(Long customerId)
			throws InvalidParameterException, CustomerNotFoundException;

	List<Long> getCustomerIds(Long accountId) throws InvalidParameterException,
			AccountNotFoundException;

	Account getAccount(Long accountId) throws InvalidParameterException,
			AccountNotFoundException;

	void removeAccount(Long accountId) throws InvalidParameterException,
			AccountNotFoundException;

	List<Account> getServiceAccounts() throws InvalidParameterException,
			AccountNotFoundException;

	void removeCustomerFromAccount(Long customerId, Long accountId)
			throws InvalidParameterException, CustomerNotFoundException,
			AccountNotFoundException;
	
	boolean validateAccount(Long accNo)throws InvalidParameterException,
	AccountNotFoundException;
}
